<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./dist/app.js"></script>
    <!-- <script>
      let oUl = {
        tagName: "ul",
        props: {
          id: "app",
        },
        children: [
          {
            tagName: "li",
            props: null,
            children: "1",
          },
          {
            tagName: "li",
            props: null,
            children: "2",
          },
          {
            tagName: "li",
            props: null,
            children: "3",
          },
        ],
      };
      //   封装一个函数，将虚拟的dom节点转换为真实的dom
      function realDom(vNode) {
        //   1.解构虚拟DOM标签，生成真实的dom
        const { tagName, props, children } = vNode;
        let rNode = document.createAttribute(tagName);
        // 给Dom节点添加属性
        // Object.keys方法
        Object.keys(props).forEach((item) => {
          rNode[item] = props[item];
        });
      }
      realDom(oUl);
    </script> -->
  </body>
</html>
